package SystemDataTypes;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Administrador
 */
public class Vector3 {

    public Vector3()
    {
        x=0;
        y=0;
        z=0;
    };
     
    public void sumar(Vector3 b)
    {
        this.x+=b.x;
        this.y+=b.y;
        this.z+=b.z;
    }
         
    public void dividir(float d)
    {
        this.x/=d;
        this.y/=d;
        this.z/=d;
    }
    
    public double distancia(Vector3 b)
    {  
        return Math.sqrt(Math.pow((b.x-this.x),2)+Math.pow((b.y-this.y),2)+Math.pow((b.z-this.z),2));
    }
    
    public Vector3(double x, double y, double z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }
    
    public String toString()
    {
    	return "["+x+","+y+","+z+"]";
    }
    
    public double x, y, z;
    
}
